<?
include('../db/koneksi.php');
$nm_tbl=$_POST['nm_tbl'];
$result = mysql_query("SHOW COLUMNS FROM $nm_tbl");
$resultxx = mysql_query("SHOW COLUMNS FROM $nm_tbl");
$judul_atas=split('_',strtolower($nm_tbl));
$jum_atas=count($judul_atas);
$title='$Edit';
for($a=0;$a<$jum_atas;$a++){
$title=$title.''.ucwords($judul_atas[$a]);
}
$l=1;
if (mysql_num_rows($resultxx) > 0) {
	while ($rowxx = mysql_fetch_assoc($resultxx)) {
	$index[$l]=strtolower($rowxx['Field']);
	$l++;
	}
	
	}
?>
<hr>

<code>

&lt;?<br>
include('../db/koneksi.php');<br>
include('../db/manipulasi_table.php');<br>
//==========================Edit table================================<br>
$sql="UPDATE <?=$nm_tbl?> SET
<?
if (mysql_num_rows($result) > 0) {
    while ($row = mysql_fetch_assoc($result)) {
	$yap=split('_',strtolower($row['Field']));
	$jum=count($yap);
	$judul=null;
	for($i=0;$i<$jum;$i++){
	$judul=$judul.' '.ucwords($yap[$i]);
	}
	?>
		 <?=$row['Field'];?>='".$_GET['<?=strtolower($row['Field']);?>']."',<br>
       
  <?  }
}
 
?>
WHERE <?=$index[1]?>='".$_GET['<?=$index[1]?>']."'";
//hialngkan satu koma terakhir sebelum where
<br>
update_table($sql);<br>
//============================= END ============================<br>
?&gt;
&lt;script&gt;window.opener.location.reload();window.close();&lt;/script&gt;

</code>